home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 001-100 / 001-025 / 002 / make / make.man < prev    next >
Text File  |  1995-03-17  |  9KB  |  300 lines

  1. MAKE(I)                3/10/84                    MAKE(I)
  2.  
  3.  
  4.  
  5. NAME
  6.     MAKE - maintain multiple source files (VAX/VMS and MSDOS 2.0)
  7.  
  8.  
  9. SYNOPSIS
  10.     MAKE [-N] [-A] [-D] [-I] [-K] [-F makefile] [name ...]
  11.  
  12.  
  13. DESCRIPTION
  14.     MAKE is a utility inspired by the Unix(tm) command of the same
  15.     name.  MAKE helps maintain programs that are constructed from
  16.     many files.  MAKE processes a "makefile", a file which describes
  17.     how to build a program from its source files, and produces a
  18.     script file containing the commands necessary to recompile the
  19.     program.
  20.  
  21.     Be careful: this MAKE is NOT compatible with Unix(tm) MAKE!
  22.  
  23.     The 'N' option causes MAKE to print out the steps it would follow
  24.     in order to rebuild the program.  The 'A' option tells MAKE to
  25.     assume that all files are obsolete, and that everything should be
  26.     recompiled.  The 'I' option tells MAKE to ignore any error statuses
  27.     returned when MAKE executes a program.  The 'K' option tells MAKE
  28.     to continue compiling anything that does not depend on an entry
  29.     that had an error during the compilation.  The 'F' option, followed
  30.     by a filename, can be used to specify a makefile other than the
  31.     default one.
  32.  
  33.     If no names are specified in the commandline, the first dependency
  34.     in the makefile is examined.  Otherwise, the specified root names
  35.     are brought up to date.
  36.  
  37.     The default makefiles are:
  38.  
  39.         for VAX/VMS:    MAKEFILE
  40.                 [-]MAKEFILE
  41.                 SYS$LOGIN:MAKEFILE
  42.  
  43.         for MSDOS:    MAKEFILE
  44.                 ..\MAKEFILE
  45.  
  46.     If the first makefile cannot be found, MAKE attempts to use the
  47.     next one.  If no makefile is ever found, MAKE prints a diagnostic
  48.     and aborts.
  49.  
  50. THE MAKEFILE
  51.     Comments begin with '#' and extend to the end of the line.  A
  52.     '#' (or almost any other character) may be escaped with the escape
  53.     character (backslash (\) on VMS, backquote (`) on MSDOS).  An escape
  54.     character may be typed by doubling it (\\ or ``).  The standard
  55.     Unix escape codes are recognized (\n, \r, \t, \b, \f, `n, `r, `t,
  56.     `b and `f).
  57.  
  58.     A makefile is a list of dependencies and library definitions.  A 
  59.     dependency consists of a root name, a colon, and zero or more names
  60.     of dependent files.  (The colon MUST be preceeded by whitespace.)
  61.     For instance, in:
  62.  
  63.         make.exe : make.obj parsedir.obj file.obj macro.obj mk.h
  64.  
  65.     the file 'make.exe' depends on five other files.  A library definition 
  66.     consists of a root name, a vertical bar (|), and zero or more names of
  67.     library entry points.  (The vertical bar MUST be preceded by 
  68.     whitespace.)  For instance, in:
  69.  
  70.         ibm.lib | ibmtext ibmsound ibmkeys ibmser ibm_com
  71.  
  72.     the file 'ibm.lib' has five entry points.  Library definitions are
  73.     useful for updating libraries without maintaining copies of the object
  74.     files for the source files.  The library entry points have the same
  75.     date and time as the library itself, and so if the entry depend on the
  76.     proper source files, all modified source files will be recompiled
  77.     whenever necessary.
  78.  
  79.     A dependent file may be a member of an ARCHIVE.  An ARCHIVE is a
  80.         collection of files with date and time stamps.  An example of an
  81.         archive definition is:
  82.     
  83.     make.obj : make.lar ( make.c make.h )
  84.     
  85.     In this definition, make.c and make.h are members of the archive
  86.         make.lar.  If make.obj must be rebuilt and either make.c or make.h
  87.         is not found in the current directory, they will be copied out of
  88.         the archive, compiled, and deleted at the end of the make session.
  89.     
  90.     Archive definitions are meaningless in a library definition, and so
  91.         should not be used.    
  92.  
  93.     A root name with an empty dependency, as in:
  94.  
  95.         print :
  96.  
  97.     is assumed NEVER up to date, and will always be recompiled.
  98.  
  99.     The dependency list or library definition may be continued on
  100.     successive lines:
  101.  
  102.         bigfile.exe : one.obj two.obj three.obj four.obj
  103.         five.obj six.obj gronk.obj freeple.obj scuzzy.lnk
  104.         frog.txt greeble.out
  105.  
  106.             OR
  107.  
  108.         msdos.lib | alloc char_io disk_io file_io exec filesize
  109.         freedisk freemem insert mouse port_io randg syscall 
  110.         sysclock sysint textsf timer ttime ucsd ucsdhelp unix
  111.  
  112.     Any number of 'method' lines may follow a dependency.  Method lines
  113.     begin with an ascii tab.  When a file is to be rebuilt, MAKE
  114.     executes these method lines (minus the tab).  
  115.     For example, in:
  116.  
  117.         make.exe : make.obj parsedir.obj file.obj macro.obj mk.h
  118.             $link make, parsedir, file, macro
  119.             $write sys$output "Just another version of MAKE ..."
  120.             $purge
  121.  
  122.     the three lines following the dependency make up the method for
  123.     recompiling (or in this case, re-linking) the file 'make.exe'.
  124.  
  125.     Library definitions may have method lines.  These methods will 
  126.     *always* be executed, since the entry points have the same date
  127.     as the library.
  128.  
  129.     If the macro "~INIT" is defined, its text will be executed first. 
  130.     If the macro "~DEINIT" is defined, its text will be executed last.
  131.     By defining these two macros, it is possible to configure the shell 
  132.     enviroment:
  133.  
  134.         ~INIT = $set term/nowrap\n$on error then goto err_handler
  135.         ~DEINIT = $set term/wrap\n$exit\$err_handler:\n
  136.         ~DEINIT = #(~DEINIT)$type err.log\n$exit
  137.  
  138.     will be executed as:
  139.  
  140.         $set term/nowrap
  141.         $on error then goto err_handler
  142.         .
  143.         .
  144.         $set term/wrap
  145.         $exit
  146.         $err_handler:
  147.         $type err.log
  148.         $exit
  149.  
  150.     When a root's method is defined, the value of the macro "~BEFORE"
  151.     is prefixed to the method, and the value of the macro "~AFTER" is
  152.     appended to it.
  153.  
  154.     Frequently one wants to maintain more than one program with a single
  155.     makefile.  In this case, a "master dependency" can appear first in
  156.     the file:
  157.  
  158.         allOfMyToolsAndHorribleHacks : cat peek poke.exe grunge
  159.         cat : cat.exe
  160.         cat.exe : ....
  161.             (stuff for CAT.EXE)
  162.         peek : peek.exe
  163.         peek.exe : (stuff for PEEK.EXE)
  164.         poke.exe : (stuff for POKE.EXE)
  165.         grunge : grunge.com
  166.         grunge.com : (stuff for grung)
  167.  
  168.     In other words, make will bring everything up to date that is somehow
  169.     connected to the first dependency (its assumed that the incredibly
  170.     lengthy filename specified in this example won't actually exist).
  171.  
  172. MACROS
  173.     A macro is defined by a line of the form (the '=' MUST be surrounded
  174.     by whitespace):
  175.  
  176.         <macro-name> = <macro-body>
  177.  
  178.     A macro may be deleted by assigning an empty value to it.  Macros
  179.     may be redefined, but old definitions stay around.  If a macro is
  180.     redefined, and the redefinition is later deleted, the first definition
  181.     will take effect:
  182.  
  183.         MAC = first            ! MAC = "first"
  184.         MAC = second            ! MAC = "second"
  185.         MAC = #(MAC) third        ! MAC = "second third"
  186.         MAC =                ! MAC = "second"
  187.         MAC =                ! MAC = "first"
  188.         MAC =                ! MAC has no definition
  189.  
  190.     A macro may be referenced in two ways:
  191.  
  192.             #<char>      or    #(macro-name)
  193.  
  194.     The first way only works if the macro's name is a single character.
  195.     If the macro's name is longer than one character, it must be
  196.     enclosed in parenthesis.  ['#' may be escaped by doubling it ("##".)]
  197.     For example, in:
  198.  
  199.         G = mk.h mk1.h
  200.         OBJS = make.obj file.obj parsedir.obj macro.obj
  201.         BOTH = #(OBJS) #G
  202.     
  203.         make.exe : #(OBJS) #G
  204.         make.exe : #(BOTH)
  205.         make.exe : mk.h mk1.h make.obj file.obj parsedir.obj macro.obj
  206.             $write sys$output "This is a number sign --> ##"
  207.  
  208.     after macro expansion, the three dependencies will appear identical
  209.     and the two '#'s in the last line will turn into one '#'.
  210.  
  211. UNIX(tm) MAKE AND THIS ONE
  212.     They are NOT the same.  Do not expect Unix makefiles to work with
  213.     this MAKE, even if you change the pathnames.  There are some major
  214.     differences between this version and the standard Unix(tm) MAKE:
  215.  
  216.     1. The Unix(tm) comment character is '#', VAX/VMS's is '!'.
  217.  
  218.     2. The Unix(tm) macro-expansion character is '$'.  While this would
  219.        have been easy to leave the same, the '$' character is used so
  220.        often in VAX/VMS command-lines that I thought it best to change
  221.        it to '#'.
  222.  
  223.     3. Multiple root names are not allowed.  Unix(tm) MAKE accepts lines
  224.        of the form:
  225.  
  226.         name1 name2 : depend1 depend2
  227.  
  228.        but this one doesn't.
  229.  
  230.     4. There is no equivalent of double-colon ("::".)
  231.  
  232.     5. There is no equivalent of .SUFFIXES, or the corresponding special
  233.        macros.
  234.  
  235. SAMPLE MAKEFILE
  236.     !
  237.     ! VAX/VMS MAKE
  238.     ! Landon Dyer
  239.     !
  240.     H = make.h
  241.     FILES = #H, make.c, macro.c, token.c, parsedir.c, file.c
  242.     DOCUMENTATION = distr.mem make.man makefile. make.com
  243.     
  244.     make.exe : make.obj macro.obj token.obj parsedir.obj file.obj
  245.         $link make.obj, macro, token, parsedir, file
  246.         $purge
  247.     
  248.     make.obj : make.c #H
  249.         $cc make.c
  250.     
  251.     macro.obj : macro.c #H
  252.         $cc macro
  253.     
  254.     token.obj : token.c #H
  255.         $cc token
  256.     
  257.     parsedir.obj : parsedir.c #H
  258.         $cc parsedir
  259.     
  260.     file.obj : file.c
  261.         $cc file
  262.     
  263.     !
  264.     ! Print files associated with MAKE
  265.     !
  266.     print :
  267.         $print make.man, #(FILES), make.com, makefile.
  268.     
  269.     !
  270.     ! Type out source to MAKE
  271.     !
  272.     type :
  273.         $type #(FILES), make.com, makefile.
  274.     
  275.     !
  276.     ! Make backup of source files.
  277.     !
  278.     BACKUP = [.bak]
  279.     backup :
  280.         $copy #(FILES) #(BACKUP)
  281.         $copy make.man, make.com, makefile. #(BACKUP)
  282.     
  283.     !
  284.     ! Collect MAKE into a distribution file.
  285.     !
  286.     collect :
  287.         $collect collect distr.mem make.man makefile make.com make.h -
  288.             make.c macro.c token.c parsedir.c file.c
  289.  
  290.  
  291. AUTHOR
  292.     Landon Dyer            G.DYER@SU-SCORE.ARPA
  293.     175 Calvert Dr. #F-211        BASHFL::DYER (Atari Coinop)
  294.     Cupertino, CA 95014
  295.  
  296. MODIFIED BY
  297.     Eric C. Brown            brownc@utah-cs.arpa
  298.     1302 Austin Hall        ...!harpo!utah-cs!brownc
  299.     University of Utah, SLC, UT 84112
  300.